<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery.js"></script>
    <script type="text/javascript">
        function login() {
            $.ajax({
                type: 'POST',
                contentType:'application/json;charset=UTF-8',
                url: '/api/public/login',
                dataType: 'json',
                data: JSON.stringify({passport:document.getElementById('passport').value,password:document.getElementById('password').value,checkcode:'abcd'}),
                success: (res)=>{
                    if(res.code == 1) {
                        window.location.href = '/doc.html';
                    }
                }
            });
        }
    </script>
</head>
<body>
    <table>
        <tr>
            <td>账号:</td>
            <td><input id="passport"/></td>
        </tr>
        <tr>
            <td>密码:</td>
            <td><input id="password"/></td>
        </tr>
        <tr>
            <td colspan="2">
                <button onclick="login()">登录</button>
            </td>
        </tr>
    </table>
</body>
</html>
